/*
 * LinkedMeActivity.java
 * business
 *
 * Created by SunDing on 2017/1/16.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.linkedme;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.utils.ActivityUtils;

/** 处理linkedMe sdk返回的参数 并作出操作. */
public class LinkedMeActivity extends BaseActivity {

    private LinkedMeFragment linkedmeFragment;

    public static void actionStart(Activity activity) {
        Intent intent = new Intent(activity, LinkedMeActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        linkedmeFragment =
                (LinkedMeFragment)
                        getSupportFragmentManager().findFragmentById(R.id.container_linked_me);

        if (linkedmeFragment == null) {
            linkedmeFragment = LinkedMeFragment.getInstance();
            ActivityUtils.addFragmentToActivity(
                    getSupportFragmentManager(), linkedmeFragment, R.id.container_linked_me);
        }
    }

    @Override
    protected void initPresenter() {
        new LinkedMePresenter(linkedmeFragment);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_linkedme;
    }
}
